-- ================================================
-- Template generated from Template Explorer using:
-- Create Procedure (New Menu).SQL
--
-- Use the Specify Values for Template Parameters 
-- command (Ctrl-Shift-M) to fill in the parameter 
-- values below.
--
-- This block of comments will not be included in
-- the definition of the procedure.
-- ================================================
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
use ExpoDatabases
go


Drop PROCEDURE [ReportExpoInformation]
go
CREATE PROCEDURE[dbo].[ReportExpoInformation]
AS
BEGIN
    -- Insert statements for procedure here
	SELECT venue
	FROM ExpoInformation 
END
GO

Drop PROCEDURE [ReportExhibitorFinancialList]
go
CREATE PROCEDURE[dbo].[ReportExhibitorFinancialList]
(@dfrom datetime,
@dto datetime)
AS
BEGIN
    -- Insert statements for procedure here
	SELECT id,firstname,lastname,address,accountBank,bankName,registerDate 
	FROM Exhibitor 
	WHERE (registerDate>=@dfrom) and (registerDate<=@dto) 
END
GO



Drop PROCEDURE [ReportBoothAuditTrail]
go
CREATE PROCEDURE[dbo].[ReportBoothAuditTrail]
(@dfrom datetime,
@dto datetime)
AS
BEGIN
    -- Insert statements for procedure here
	SELECT id,[name],[space],spaceUnitMeasureID,fees,sponsor,exhibitorID,status,registerDate,lastDate,modifiedDate
	FROM BoothInformation 
	WHERE (registerDate>=@dfrom) and (registerDate<=@dto) 
END
GO

Drop PROCEDURE [ReportCashReceiptsByDateTotal]
go
CREATE PROCEDURE[dbo].[ReportCashReceiptsByDateTotal]
(@dfrom datetime,
@dto datetime)
AS
BEGIN
    -- Insert statements for procedure here
	SELECT registerDate,sum(fees)
	from BoothInformation
	where (registerDate>=@dfrom) and (registerDate<=@dto) 
	group by(registerDate)
END
GO

Drop PROCEDURE [ReportCashReceiptsByDate]
go
CREATE PROCEDURE[dbo].[ReportCashReceiptsByDate]
(@dfrom datetime,
@dto datetime)
AS
BEGIN
    -- Insert statements for procedure here
	SELECT [name],fees,exhibitorID,registerDate
	from BoothInformation
	where (registerDate>=@dfrom) and (registerDate<=@dto) 
	group by(registerDate)
END
GO

Drop PROCEDURE [ReportDepositSlip]
go
CREATE PROCEDURE[dbo].[ReportDepositSlip]
(@dfrom datetime,
@dto datetime)
AS
BEGIN
    -- Insert statements for procedure here
	SELECT id,[name],[space],fees,sponsor,exhibitorID,status,registerDate,lastDate
	from BoothInformation 
	where (registerDate>=@dfrom) and (registerDate<=@dto) 
END
GO

Drop PROCEDURE [ReportStatements]
go
CREATE PROCEDURE[dbo].[ReportStatements]
(@dfrom datetime,
@dto datetime)
AS
BEGIN
    -- Insert statements for procedure here
	SELECT id,[name],[space],fees,sponsor,exhibitorID,status,registerDate,lastDate 
	from BoothInformation 
	where (registerDate>=@dfrom) and (registerDate<=@dto) 
END
GO

Drop PROCEDURE [ReportAccountingSummary]
go
CREATE PROCEDURE[dbo].[ReportAccountingSummary]
(@dfrom datetime,
@dto datetime)
AS
BEGIN
    -- Insert statements for procedure here
	SELECT 
		* 
	from 
		Exhibitor E inner join BoothInformation B on E.id=B.exhibitorID
					inner join BoothProduct P on B.id=P.boothID 
	where 
		(registerDate>=@dfrom) and (registerDate<=@dto) 
END
GO

select * from Exhibitor
go
select * from BoothInformation
go
select * from BoothProduct
go

Drop PROCEDURE [ReportStatus]
go
CREATE PROCEDURE[dbo].[ReportStatus]
(@dfrom datetime,
@dto datetime)
AS
BEGIN
    -- Insert statements for procedure here
	SELECT 
		* 
	from 
		Exhibitor E inner join BoothInformation B on E.id=B.exhibitorID
					inner join BoothProduct P on B.id=P.boothID 
	where 
		(registerDate>=@dfrom) and (registerDate<=@dto) 
END
GO

Drop PROCEDURE [ReportAndOfMonth]
go
CREATE PROCEDURE[dbo].[ReportAndOfMonth]
(@dfrom datetime,
@dto datetime)
AS
BEGIN
    -- Insert statements for procedure here
	SELECT 
		* 
	from 
		Exhibitor E inner join BoothInformation B on E.id=B.exhibitorID
					inner join BoothProduct P on B.id=P.boothID 
	where 
		(registerDate>=@dfrom) and (registerDate<=@dto) 
END
GO